コード例 #1
0
KListDebugDialog::KListDebugDialog(QStringList areaList, QWidget *parent, const char *name, bool modal)
    : KAbstractDebugDialog(parent, name, modal), m_areaList(areaList)
{
    setCaption(i18n("Debug Settings"));

    QVBoxLayout *lay = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());

    m_incrSearch = new KLineEdit(this);
    lay->addWidget(m_incrSearch);
    connect(m_incrSearch, SIGNAL(textChanged(const QString &)), SLOT(generateCheckBoxes(const QString &)));

    QScrollView *scrollView = new QScrollView(this);
    scrollView->setResizePolicy(QScrollView::AutoOneFit);
    lay->addWidget(scrollView);

    m_box = new QVBox(scrollView->viewport());
    scrollView->addChild(m_box);

    generateCheckBoxes(QString::null);

    QHBoxLayout *selectButs = new QHBoxLayout(lay);
    QPushButton *all = new QPushButton(i18n("&Select All"), this);
    QPushButton *none = new QPushButton(i18n("&Deselect All"), this);
    selectButs->addWidget(all);
    selectButs->addWidget(none);

    connect(all, SIGNAL(clicked()), this, SLOT(selectAll()));
    connect(none, SIGNAL(clicked()), this, SLOT(deSelectAll()));

    buildButtons(lay);
    resize(350, 400);
}
コード例 #2
0
void UBGraphicsItemDelegate::init()
{
    mFrame = new UBGraphicsDelegateFrame(this, QRectF(0, 0, 0, 0), mFrameWidth, mRespectRatio);
    mFrame->hide();
    mFrame->setZValue(UBGraphicsScene::toolLayerStart + 1);
    mFrame->setFlag(QGraphicsItem::ItemIsSelectable, true);

    mDeleteButton = new DelegateButton(":/images/close.svg", mDelegated, mFrame);
    mButtons << mDeleteButton;
    connect(mDeleteButton, SIGNAL(clicked()), this, SLOT(remove()));
    if (canDuplicate()){
        mDuplicateButton = new DelegateButton(":/images/duplicate.svg", mDelegated, mFrame);
        connect(mDuplicateButton, SIGNAL(clicked(bool)), this, SLOT(duplicate()));
        mButtons << mDuplicateButton;
    }
    mMenuButton = new DelegateButton(":/images/menu.svg", mDelegated, mFrame);
    connect(mMenuButton, SIGNAL(clicked()), this, SLOT(showMenu()));
    mButtons << mMenuButton;

    buildButtons();

    foreach(DelegateButton* button, mButtons)
    {
        button->hide();
        button->setZValue(UBGraphicsScene::toolLayerStart + 2);
        button->setFlag(QGraphicsItem::ItemIsSelectable, true);
    }
コード例 #3
0
ファイル: ClassWindow.cpp プロジェクト: Vrixyz/CodeA
ClassWindow::ClassWindow(int size_x, int size_y, MyWindow *parent) : QDialog(parent, Qt::FramelessWindowHint)
{
    _parent = parent;
    setFixedSize(size_x, size_y);

    this->move(600, 250);

    setObjectName("classwin");
    setStyleSheet("#classwin { background-image: url(img/classwindow.png); }");

    buildButtons();
}
コード例 #4
0
ElevatorSimWindow::ElevatorSimWindow() :
   Fl_Window(WINDOW_WIDTH,  WINDOW_HEIGHT, WINDOW_TITLE) {
      renderWindow = new ElevatorSimRenderWindow(
         ElevatorSimRenderWindow::LEFT_MARGIN,
         ElevatorSimRenderWindow::TOP_MARGIN,
         WINDOW_WIDTH -
            (ElevatorSimRenderWindow::LEFT_MARGIN +
            ElevatorSimRenderWindow::RIGHT_MARGIN),
         WINDOW_HEIGHT -
            (ElevatorSimRenderWindow::TOP_MARGIN +
            ElevatorSimRenderWindow::BOTTOM_MARGIN));

      resizable(*renderWindow);
      buildMenu();
      buildButtons();

      /* add more widgets to main window here */

      end();

      buildDialogs();

      welcomeWin = new ElevatorSimWelcomeWindow();
      startWin = new ElevatorSimStartWindow();
      resultsWin = new ElevatorSimResultsWindow();

      /* some hackery to set the application icon in windows */
      #ifdef _ES_WINNT
      HANDLE iconImage = LoadImage(
         GetModuleHandle(NULL),
         MAKEINTRESOURCE(IDI_ELEVATOR_SIM_ICON),
         IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR);

      if(iconImage == NULL) {
         std::cout << "warning: failed to load application icon!" << std::endl;
      } else {
         if(isDebugBuild()) {
            std::stringstream dbgSS;
            dbgSS << "loaded app icon OK @ " << (void*)iconImage << std::endl;
            LOG_INFO( Logger::SUB_FLTK, sstreamToBuffer(dbgSS) );
         }

         icon( (const void*) iconImage );
      }
      #endif

      callback((Fl_Callback*)windowCloseCB, this);

      /* add more callbacks to main window here */

      /* initialize any other main window member variables here */
}
コード例 #5
0
ファイル: kdebugdialog.cpp プロジェクト: serghei/kde3-kdebase
KDebugDialog::KDebugDialog(QStringList areaList, QWidget *parent, const char *name, bool modal) : KAbstractDebugDialog(parent, name, modal)
{
    setCaption(i18n("Debug Settings"));

    QVBoxLayout *topLayout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
    if(topLayout == 0)
    {
        return;
    } // can this happen ?

    QLabel *tmpLabel = new QLabel(i18n("Debug area:"), this);
    tmpLabel->setFixedHeight(fontMetrics().lineSpacing());
    topLayout->addWidget(tmpLabel);

    // Build combo of debug areas
    pDebugAreas = new QComboBox(false, this);
    pDebugAreas->setFixedHeight(pDebugAreas->sizeHint().height());
    pDebugAreas->insertStringList(areaList);
    topLayout->addWidget(pDebugAreas);

    QGridLayout *gbox = new QGridLayout(2, 2, KDialog::marginHint());
    if(gbox == 0)
    {
        return;
    }
    topLayout->addLayout(gbox);

    QStringList destList;
    destList.append(i18n("File"));
    destList.append(i18n("Message Box"));
    destList.append(i18n("Shell"));
    destList.append(i18n("Syslog"));
    destList.append(i18n("None"));

    //
    // Upper left frame
    //
    pInfoGroup = new QGroupBox(i18n("Information"), this);
    gbox->addWidget(pInfoGroup, 0, 0);
    QVBoxLayout *vbox = new QVBoxLayout(pInfoGroup, KDialog::spacingHint());
    vbox->addSpacing(fontMetrics().lineSpacing());
    pInfoLabel1 = new QLabel(i18n("Output to:"), pInfoGroup);
    vbox->addWidget(pInfoLabel1);
    pInfoCombo = new QComboBox(false, pInfoGroup);
    connect(pInfoCombo, SIGNAL(activated(int)), this, SLOT(slotDestinationChanged(int)));
    vbox->addWidget(pInfoCombo);
    pInfoCombo->insertStringList(destList);
    pInfoLabel2 = new QLabel(i18n("Filename:"), pInfoGroup);
    vbox->addWidget(pInfoLabel2);
    pInfoFile = new QLineEdit(pInfoGroup);
    vbox->addWidget(pInfoFile);
    /*
    pInfoLabel3 = new QLabel( i18n("Show only area(s):"), pInfoGroup );
    vbox->addWidget( pInfoLabel3 );
    pInfoShow = new QLineEdit( pInfoGroup );
    vbox->addWidget( pInfoShow );
    */

    //
    // Upper right frame
    //
    pWarnGroup = new QGroupBox(i18n("Warning"), this);
    gbox->addWidget(pWarnGroup, 0, 1);
    vbox = new QVBoxLayout(pWarnGroup, KDialog::spacingHint());
    vbox->addSpacing(fontMetrics().lineSpacing());
    pWarnLabel1 = new QLabel(i18n("Output to:"), pWarnGroup);
    vbox->addWidget(pWarnLabel1);
    pWarnCombo = new QComboBox(false, pWarnGroup);
    connect(pWarnCombo, SIGNAL(activated(int)), this, SLOT(slotDestinationChanged(int)));
    vbox->addWidget(pWarnCombo);
    pWarnCombo->insertStringList(destList);
    pWarnLabel2 = new QLabel(i18n("Filename:"), pWarnGroup);
    vbox->addWidget(pWarnLabel2);
    pWarnFile = new QLineEdit(pWarnGroup);
    vbox->addWidget(pWarnFile);
    /*
    pWarnLabel3 = new QLabel( i18n("Show only area(s):"), pWarnGroup );
    vbox->addWidget( pWarnLabel3 );
    pWarnShow = new QLineEdit( pWarnGroup );
    vbox->addWidget( pWarnShow );
    */

    //
    // Lower left frame
    //
    pErrorGroup = new QGroupBox(i18n("Error"), this);
    gbox->addWidget(pErrorGroup, 1, 0);
    vbox = new QVBoxLayout(pErrorGroup, KDialog::spacingHint());
    vbox->addSpacing(fontMetrics().lineSpacing());
    pErrorLabel1 = new QLabel(i18n("Output to:"), pErrorGroup);
    vbox->addWidget(pErrorLabel1);
    pErrorCombo = new QComboBox(false, pErrorGroup);
    connect(pErrorCombo, SIGNAL(activated(int)), this, SLOT(slotDestinationChanged(int)));
    vbox->addWidget(pErrorCombo);
    pErrorCombo->insertStringList(destList);
    pErrorLabel2 = new QLabel(i18n("Filename:"), pErrorGroup);
    vbox->addWidget(pErrorLabel2);
    pErrorFile = new QLineEdit(pErrorGroup);
    vbox->addWidget(pErrorFile);
    /*
    pErrorLabel3 = new QLabel( i18n("Show only area(s):"), pErrorGroup );
    vbox->addWidget( pErrorLabel3 );
    pErrorShow = new QLineEdit( pErrorGroup );
    vbox->addWidget( pErrorShow );
    */

    //
    // Lower right frame
    //
    pFatalGroup = new QGroupBox(i18n("Fatal Error"), this);
    gbox->addWidget(pFatalGroup, 1, 1);
    vbox = new QVBoxLayout(pFatalGroup, KDialog::spacingHint());
    vbox->addSpacing(fontMetrics().lineSpacing());
    pFatalLabel1 = new QLabel(i18n("Output to:"), pFatalGroup);
    vbox->addWidget(pFatalLabel1);
    pFatalCombo = new QComboBox(false, pFatalGroup);
    connect(pFatalCombo, SIGNAL(activated(int)), this, SLOT(slotDestinationChanged(int)));
    vbox->addWidget(pFatalCombo);
    pFatalCombo->insertStringList(destList);
    pFatalLabel2 = new QLabel(i18n("Filename:"), pFatalGroup);
    vbox->addWidget(pFatalLabel2);
    pFatalFile = new QLineEdit(pFatalGroup);
    vbox->addWidget(pFatalFile);
    /*
    pFatalLabel3 = new QLabel( i18n("Show only area(s):"), pFatalGroup );
    vbox->addWidget( pFatalLabel3 );
    pFatalShow = new QLineEdit( pFatalGroup );
    vbox->addWidget( pFatalShow );
    */


    pAbortFatal = new QCheckBox(i18n("Abort on fatal errors"), this);
    topLayout->addWidget(pAbortFatal);

    topLayout->addStretch();
    KSeparator *hline = new KSeparator(KSeparator::HLine, this);
    topLayout->addWidget(hline);

    buildButtons(topLayout);

    connect(pDebugAreas, SIGNAL(activated(const QString &)), SLOT(slotDebugAreaChanged(const QString &)));

    // Get initial values ("initial" is understood by the slot)
    slotDebugAreaChanged("0 initial");
    slotDestinationChanged(0);

    resize(300, height());
}