Extract layout code to ui file
authorRafał Długołęcki <rafal@dlugolecki.net.pl>
Thu, 21 Jan 2016 18:10:32 +0000 (19:10 +0100)
committerRafał Długołęcki <rafal@dlugolecki.net.pl>
Thu, 21 Jan 2016 18:10:32 +0000 (19:10 +0100)
src/kernel/kernel.cpp
src/kernel/kernel.h
src/kernel/kernelwindow.ui

index 49c9314e6e1482bc6dcea88f2a0eed92a1573beb..98debb07475a8446070aaeb5d7985e0d386d32b9 100644 (file)
@@ -132,16 +132,6 @@ QKernel::QKernel()
 
        LOCKED = FALSE;
 
-       desktop = new QTextEdit(this);
-       desktop->setReadOnly(TRUE);
-       QVBoxLayout * layout = new QVBoxLayout();
-       layout->setContentsMargins (3, 0, 3, 0);
-       layout->addWidget(desktop);
-       QWidget *window = new QWidget();
-       window->setLayout(layout);
-       setCentralWidget(window);
-
-       resize(400, 200);
        Tasks = 0;
        freeINTid = 1;
        ActiveConnections = 0;
@@ -153,18 +143,6 @@ QKernel::QKernel()
        connect(Net_Notify, SIGNAL(activated(int)), this, SLOT(NetMessage()));
 }
 
-/**
- * Event invoked on resizing kernel application window.
- * @copydoc QWidget::resizeEvent(QResizeEvent*)
- */
-void QKernel::resizeEvent(QResizeEvent *ev)
-{
-//     QFrame::resizeEvent(ev);
-//     if (desktop)
-//             desktop->setGeometry(0, bar->height(), width(), 
-//                                             height() - bar->height());
-}
-
 /**
  * Displays window with information about not implemented functionality.
  */
@@ -1051,7 +1029,7 @@ void QKernel::on_actionUnlock_console_triggered()
 
        QPushButton cb("Cancel", &d);
        cb.setGeometry(130, 60, 80, 30);
-       connect(&cb, SIGNAL(clicked()), &d, SLOT(reject())); 
+       connect(&cb, SIGNAL(clicked()), &d, SLOT(reject()));
 
        d.resize(240, 100);
 
index e0843cb09fed52fbc9a7c2965c3847353f76c9cc..13494ea14501afe438e37af3b90e8d9f7ecc54e7 100644 (file)
@@ -95,10 +95,6 @@ public:
 class QKernel : public QMainWindow, private Ui::KernelWindow {
        Q_OBJECT
 public:
-       QTextEdit *desktop;
-       QMenuBar *bar;
-       QMenu *programMenu;
-       QMenu *machineMenu;
        QMenu *toolsMenu;
        char progdir[256];
        int NodeNumber;
@@ -106,8 +102,6 @@ public:
 
        QKernel();
 
-       virtual void resizeEvent(QResizeEvent *ev);
-
        void WriteMessage(char* msg);
        void InitMessage();
 
@@ -143,7 +137,6 @@ private:
        bool synchro;
        bool wait_for_info;
        char LockPasswd[25];
-       QAction * quitAction;
        
        int net_sock;
        int freeINTid;
index 0b4170ce1bceeddf5efa183ec529551c35c1c475..04e255dd825824e113b0822997559efefb767829 100644 (file)
   <property name="windowTitle">
    <string>MainWindow</string>
   </property>
-  <widget class="QWidget" name="centralwidget"/>
+  <widget class="QWidget" name="centralwidget">
+   <layout class="QVBoxLayout" name="verticalLayout_2">
+    <property name="leftMargin">
+     <number>3</number>
+    </property>
+    <property name="topMargin">
+     <number>0</number>
+    </property>
+    <property name="rightMargin">
+     <number>3</number>
+    </property>
+    <property name="bottomMargin">
+     <number>0</number>
+    </property>
+    <item>
+     <widget class="QTextEdit" name="desktop">
+      <property name="readOnly">
+       <bool>true</bool>
+      </property>
+     </widget>
+    </item>
+   </layout>
+  </widget>
   <widget class="QMenuBar" name="menubar">
    <property name="geometry">
     <rect>